package com.gitee.hljdrl.ffkit.builder;

import android.app.Activity;
import android.content.Context;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.gitee.hljdrl.ffkit.bean.FFKitGroup;
import com.gitee.hljdrl.ffkit.bean.FFKitLink;

import java.util.List;

public abstract class FFKitLinkSource {


    protected Activity mActivity;

    public FFKitLinkSource() {

    }

    public void setActivity(Activity activity) {
        this.mActivity = activity;
    }

    protected Activity getActivity() {
        return this.mActivity;
    }

    public abstract List<FFKitLink> getList();

    public List<FFKitGroup> getGroupList() {
        return null;
    }

    public RecyclerView.LayoutManager getLayoutManager(Context context) {
        //--------------------------------------------------------------------
        //TODO 网格布局
        GridLayoutManager layoutManager = new GridLayoutManager(context, 2);//第二个参数为网格的列数
        return layoutManager;
        //--------------------------------------------------------------------
        //TODO 列表布局
//        GridLayoutManager layoutManager = new GridLayoutManager(context, 1);//第二个参数为网格的列数
//        return layoutManager;
        //--------------------------------------------------------------------
    }

    public boolean isOverlayList() {
        return false;
    }

    public abstract String getAppName();
}
